Telegram Group & Telegram Channel
Работаем с картинками в Python

Библиотека Pillow — это очень мощный, быстрый и удобный инструмент для обработки графики в Python.

В сегодняшнем примере мы применим ее для конвертации картинки в черно-белую, обратим цвета, вертикально отзеркалим и сохраним в файл.

Метод Image.open('resources/img/cat.jpg') считывает картинку из папки.

img.convert('L') трансформирует картинку в черно-белую.

ImageOps.invert(image) обращает цвета.

img.transpose(Image.FLIP_LEFT_RIGHT) вертикально отзеркаливает картинку.

img.save('grayscale_cat.jpg') сохранит картинку на диске.

Больше официальных примеров и документацию можно посмотреть тут.

Пример можно посмотреть тут.

#pillow



tg-me.com/python_academy/1998
Create:
Last Update:

Работаем с картинками в Python

Библиотека Pillow — это очень мощный, быстрый и удобный инструмент для обработки графики в Python.

В сегодняшнем примере мы применим ее для конвертации картинки в черно-белую, обратим цвета, вертикально отзеркалим и сохраним в файл.

Метод Image.open('resources/img/cat.jpg') считывает картинку из папки.

img.convert('L') трансформирует картинку в черно-белую.

ImageOps.invert(image) обращает цвета.

img.transpose(Image.FLIP_LEFT_RIGHT) вертикально отзеркаливает картинку.

img.save('grayscale_cat.jpg') сохранит картинку на диске.

Больше официальных примеров и документацию можно посмотреть тут.

Пример можно посмотреть тут.

#pillow

BY Python Academy




Share with your friend now:
tg-me.com/python_academy/1998

View MORE
Open in Telegram


Python Academy Telegram | DID YOU KNOW?

Date: |

That growth environment will include rising inflation and interest rates. Those upward shifts naturally accompany healthy growth periods as the demand for resources, products and services rise. Importantly, the Federal Reserve has laid out the rationale for not interfering with that natural growth transition.It's not exactly a fad, but there is a widespread willingness to pay up for a growth story. Classic fundamental analysis takes a back seat. Even negative earnings are ignored. In fact, positive earnings seem to be a limiting measure, producing the question, "Is that all you've got?" The preference is a vision of untold riches when the exciting story plays out as expected.

Look for Channels Online

You guessed it – the internet is your friend. A good place to start looking for Telegram channels is Reddit. This is one of the biggest sites on the internet, with millions of communities, including those from Telegram.Then, you can search one of the many dedicated websites for Telegram channel searching. One of them is telegram-group.com. This website has many categories and a really simple user interface. Another great site is telegram channels.me. It has even more channels than the previous one, and an even better user experience.These are just some of the many available websites. You can look them up online if you’re not satisfied with these two. All of these sites list only public channels. If you want to join a private channel, you’ll have to ask one of its members to invite you.

Python Academy from nl


Telegram Python Academy
FROM USA